import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'

// 静态路由
export const commonRoutes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/home',
    meta: {
      title: '首页',
      hidden: true,
    },
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/Home/index.vue'),
    meta: {
      title: '首页',
      hidden: true,
    },
  },
]

// 将静态路由 和 自定义路由进行整合
export const allRoutes: RouteRecordRaw[] = [...commonRoutes]

const router = createRouter({
  history: createWebHistory(),
  routes: allRoutes,
})

export default router

